package chapter10.section4;

//程序10-4 打印数据流

import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Random;

public class PrintStreamDemo {
    public static void main(String[] args) throws FileNotFoundException {
        // PrintStream out = new PrintStream("test.dat");
        PrintWriter out = new PrintWriter("test.dat");
        Random rand = new Random();
        for (int i = 0; i < 10; i++) {
            int x = rand.nextInt(100000);
            out.println(x);
        }
        out.close();
    }
}
